/**
 * Copyright 2012 Fonfon.Fenceer
 * All rights reserved.
 * 
 * @project 
 * @author Fonfon.Fenceer
 * @version 1.0
 * @data 2012-3-9
 */
package com.guidecaptain.core.common;

import org.apache.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;

/**
 * aop 拦截 service 异常处理
 * 
 * @author fonfon
 */
public class LogerAdvice {

	private static final Logger LOG = Logger.getLogger(LogerAdvice.class);
	/**
	 * 代理执行 捕获异常
	 * 
	 * @param joinpoint
	 * @return 返回代理方法结果
	 * @throws Throwable
	 */
	public Object aroundAdvice(ProceedingJoinPoint joinpoint) throws Throwable {
		Object retVal = null;
		System.out.println("代理"+joinpoint.toString());
		try {
			retVal = joinpoint.proceed();
		} catch (Throwable e) {
//			LOG.error("代理异常"+e.getMessage(), e);
			throw e;
		}
		
		return retVal;
	}
}
